unit uGetRemoteInfo;

interface

uses
  Classes, IdHTTP, uPublic, SysUtils;

type
  GetRemoteInfo = class(TThread)
  private
    { Private declarations }
  protected
    procedure Execute; override;
  end;

implementation

{ Important: Methods and properties of objects in visual components can only be
  used in a method called using Synchronize, for example,

      Synchronize(UpdateCaption);

  and UpdateCaption could look like,

    procedure GetRemoteInfo.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ GetRemoteInfo }

procedure GetRemoteInfo.Execute;
var
  idGet: TIdHTTP;
begin
  FreeOnTerminate := True;
  idGet := TIdHTTP.Create(nil);
  try
    try
      RemoteFile^.Version := idGet.Get(RemotePath + LateST);
      idGet.Head(RemotePath + RemoteFile^.Version + '/' + RemoteFileName);
      RemoteFile^.Size := idGet.Response.ContentLength;
    finally
      ReturnValue := 1;
      FreeAndNil(idGet);
    end;
  except
    ;
  end;
end;

end.
 